<%@Page Language="VB" debug="true"%>
<%@Import Namespace="System.Drawing" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>

<script language="JScript">
<!--
function SetCheck(strCheckboxName) {
  document.all[strCheckboxName].checked = true;
}
//-->
</script>

<!-- #include file="style.inc" -->
</head>
<body bgcolor="#ffffff">
<!--------------------------------------------------------------------------->
<span class="heading">ASP:Xml Control</span><p />

<!--start-->
<ASP:Xml id="MyControl" DocumentSource="xml/books.xml" runat="server" />
<!--end-->

<p />
<div id="outError" runat="server" />

<form runat="server" method="get">
<table border="0">
<tr><td nowrap="nowrap"></td><td align="right" nowrap="nowrap">DocumentSource =</td><td nowrap="nowrap"><a href="<% = MyControl.DocumentSource %>" target="_blank"><% = MyControl.DocumentSource %></a></td><td nowrap="nowrap"></td>
<td nowrap="nowrap">&nbsp; &nbsp; &nbsp;</td>
<td nowrap="nowrap"></td><td align="right" nowrap="nowrap">ID =</td><td nowrap="nowrap"><% = MyControl.ID %></td><td nowrap="nowrap"></td></tr>
<tr><td nowrap="nowrap"><input type="checkbox" id="chkTransformSource" runat="server" /> Set: &nbsp; </td><td align="right" nowrap="nowrap">TransformSource =</td><td nowrap="nowrap"><select id="selTransformSource" size="1" runat="server" onchange="SetCheck('chkTransformSource')">
<option>{not set}</option><option>listview.xsl</option><option>tableview.xsl</option><option>reportview.xsl</option></select></td><td nowrap="nowrap"></td><td></td><td></td>
<td nowrap="nowrap"><input type="button" Value="Reset" onclick="javascript:location.href='http://<% = Request.ServerVariables("SERVER_NAME") %><% = Request.Path %>'"></td><td nowrap="nowrap"><input type="submit" Value="Update" runat="server" /></td></tr>
</table>
</form>

<script language="VB" runat="server">
Sub Page_Load(sender As Object, e As EventArgs)

outError.innerHTML = ""

Try

   If IsPostBack() Then

      If chkTransformSource.Checked _
      And Left(selTransformSource.Value, 1) <> "{" Then
         MyControl.TransformSource = "xml/" & selTransformSource.Value
      End If

   End If

   Dim strXslFileName As String
   strXslFileName = MyControl.TransformSource
   strXslFileName = Right(strXslFileName, InStrRev(strXslFileName, "/") + 1)
   selTransformSource.Value = strXslFileName

Catch objError As Exception

   outError.innerHTML = "<b>* Error</b>: " & objError.Message & "<p />"

End Try

End Sub
</script>

<!--------------------------------------------------------------------------->
<!-- #include file="foot.inc" -->
</body>
</html>
